import request from "@/router/axios";

export const getList = async (current, size, params) => {
  const data = await request({
    url: "/api/things-resource/depart/getList",
    method: "get",
    params: { current, size, ...params },
  });
  return data;
};

export const myList = async (current, size, params) => {
  const data = await request({
    url: "/api/things-resource/depart/getMyList",
    method: "get",
    params: { current, size, ...params },
  });
  return data;
};

// 获取审核列表
export const getAduitList = async (current, size, params) => {
  const data = await request({
    url: "/api/things-resource/depart/getAduitList",
    method: "get",
    params: { current, size, ...params },
  });
  return data;
};

export const aduitById = (id, type = 0) => {
  return request({
    url: "/api/things-resource/depart/updateStatusById",
    method: "post",
    data: {
      id,
      status: type,
    },
  });
};

export const remove = (id) => {
  return request({
    url: "/api/things-resource/depart/remove",
    method: "post",
    params: {
      id,
    },
  });
};

export const add = (row) => {
  return request({
    url: "/api/things-resource/depart/submit",
    method: "post",
    data: row,
  });
};

export const updateNameById = (row) => {
  return request({
    url: "/api/things-resource/depart/updateName",
    method: "post",
    data: row,
  });
};

export const addSubCatory = (data) => {
  return request({
    url: "/api/things-resource/depart/submitCatiry",
    method: "post",
    data,
  });
};

export const addSubFiles = (data) => {
  return request({
    url: "/api/things-resource/depart/submitFile",
    method: "post",
    data,
  });
};
